<?php echo form_open_multipart(uri_string())?>    
    <table class="form">
       
         <tr>
            <td class="label" style="width: 150px;">Trạng thái</td>
            <td>
                <select id="bl_active" name="bl_active" class="w300">
                    <option value="1">Kích hoạt</option>
                    <option value="0">Vô hiệu</option>
                </select>
            </td>
        </tr> 
         <tr>
            <td class="required label" style="width: 150px;">Danh mục sản phẩm</td>
            <td>
                <select id="product_category_id" name="product_category_id" class="w300">
                   <option value=""> Chọn danh mục sản phẩm</option>
                    <?php echo $option_pid ?>
                </select>
            </td>
        </tr> 
        <tr>
            <td class="required label" style="width: 150px;">Tên sản  phẩm</td>
            <td><input type="text" name="name" id="name" class="w500" value="<?php echo $item->name;?>" ></td>
        </tr>
        <tr>
            <td class="required label" style="width: 150px;">Giá bán</td>
            <td><input type="text" name="price" id="sprice" class="w500" value="<?php echo $item->price;?>" ></td>
        </tr>
         <tr>
            <td class=" label" style="width: 150px;">Giá khuyến mãi</td>
            <td><input type="text" name="sprice" id="sprice" class="w500" value="<?php echo $item->sprice;?>" ></td>
        </tr>
         <tr>
            <td class=" label" style="width: 150px;">Số lượng sản phẩm tồn kho</td>
            <td><input type="text" name="soluong" id="soluong" class="w500" value="<?php echo $item->soluong;?>" ></td>
        </tr>
        
        <tr>
        <td class="required label" style="width: 150px;">Hình ảnh đại diện</td>
        <td> 
       <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image;?>" alt="" width="100" height="100" /> <br/> 
        <input type="text" name="image" class="w350" value="" id="file_name" readonly >
         <a href="<?php echo base_url()?>file_manager/img_lib/file_name" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
         </td> 
        </tr>
        
        <tr>
            <td class="label" style="width: 150px;">Các hình ảnh khác</td>
            <td> 
              <?php if($item->image_1){ ?>
             <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image_1;?>" alt="" width="100" height="100" /> <br/> 
             <?php } ?>
            Hình 1: <input type="text" name="image_1" class="w350" value="" id="file_name1" readonly >
             <a href="<?php echo base_url()?>file_manager/img_lib/file_name1" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
             <br/>
              <?php if($item->image_2){ ?>
             <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image_2;?>" alt="" width="100" height="100" /> <br/> 
             <?php } ?>
            Hình 2: <input type="text" name="image_2" class="w350" value="" id="file_name2" readonly >
             <a href="<?php echo base_url()?>file_manager/img_lib/file_name2" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
             <br/>
              <?php if($item->image_3){ ?>
             <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image_3;?>" alt="" width="100" height="100" /> <br/> 
             <?php } ?>
             Hình 3: <input type="text" name="image_3" class="w350" value="" id="file_name3" readonly >
             <a href="<?php echo base_url()?>file_manager/img_lib/file_name3" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
             <br/>
              <?php if($item->image_4){ ?>
             <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image_4;?>" alt="" width="100" height="100" /> <br/>
             <?php } ?>
            Hình 4: <input type="text" name="image_4" class="w350" value="" id="file_name4" readonly >
             <a href="<?php echo base_url()?>file_manager/img_lib/file_name4" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
             <br/>
              <?php if($item->image_5){ ?>
             <img src="<?php echo base_url_site()."uploads/products/avatar/".$item->image_5;?>" alt="" width="100" height="100" /> <br/>
             <?php } ?>
             Hình 5: <input type="text" name="image_5" class="w350" value="" id="file_name5" readonly >
             <a href="<?php echo base_url()?>file_manager/img_lib/file_name5" id="addimages" class="cboxElement" title="<?php echo lang('file_mng_add_file');?>"> <img src="<?php echo base_url()?>templates/images/icon/attach.png" alt=""> </a>
            </td>
        </tr>
        <tr>
            <td class=" label" style="width: 150px;">Thông tin sản phẩm</td>
            <td><textarea name="features" class="mceSimple" style="width:900px; height:300px;" ><?php echo $item->features;?></textarea></td>
        </tr>
        <tr>
            <td class="required label" style="width: 150px;">Chi tiết sản phẩm</td>
            <td><textarea name="details" class="mceAdvanced" style="width:900px; height:400px;" ><?php echo $item->details;?></textarea></td>
        </tr>
         
        <tr>
            <td class="label" style="width: 150px;">Tags <br/><span>Mỗi tags được nhập cách nhau bằng dấu ,</span></td>
            <td><textarea name="meta_tags" class="dimensions_textarea"><?php echo $item->meta_tags;?></textarea></td>
        </tr>
           <tr>
            <td class="label" style="width: 150px;">Vị trí hiện thị</td>
            <td><input type="text" name="nb_order" id="nb_order" class="w500" value="<?php echo $item->nb_order;?>"></td>
        </tr> 
        <tr>
        	 <td class="label" style="width: 150px;">Chọn hiện thị ở trang chủ</td>
             <td><input type="checkbox" name="home" value="1" <?php if($item->home === 1) {echo 'checked';} ?> ></td>
                        
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" name="bt_submit" value="" class="capnhat">
            </td>
        </tr>  
    </table>
<?php echo form_close()?>
<script type="text/javascript">
$(document).ready(function(){
	<!-- CÁCH 2 SỬ DỤNG KEYPRESS CỦA JQUERY -->
	$('#price').yamFormat({type : 'int'});
	$('#sprice').yamFormat({type : 'int'});
	
})
</script>
